package com.idlecode.util;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;

public class MessageDialogUtil {

	public static void showError(String title, String message) {
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		if (shell != null) {
			MessageDialog.openError(shell, title, message);
		}
	}

	public static void showWarning(String title, String message) {
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		if (shell != null) {
			MessageDialog.openWarning(shell, title, message);
		}
	}

	public static void showMessage(String title, String message) {
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		if (shell != null) {
			MessageDialog.openInformation(shell, title, message);
		}
	}
}
